<?php

namespace Drupal\shusy_taxation\Entity;

use Drupal\shusy_taxation\ViewsController\Traits\ShusyTaxationSexTrait;
use Drupal\shusy_taxation\ViewsController\Traits\ShusyTaxationStatusTrait;
use Entity;

class ShusyTaxation extends Entity {

  public $id;

  public $vid;

  public $uid;


  public $created;

  public $changed;
  public $name;
  public $store_name;
  public $sex;
  public $ages;
  public $identity;

  public $phone;



  public $is_new_revision;

  public $store_title;

  public $remake;


  public $doctor;

  public $faith;
  public $faiths;

  public $price;

  public $doctortaxa;

  public $nowdate;
  public $doctoroimg;
  public $doctoroimg01;
  public $doctoroimg02;
  public $doctoroimgl;
  public $doctoroimgl01;
  public $doctoroimgl02;
  public $doctoroimgr;
  public $doctoroimgr01;
  public $doctoroimgr02;
  public $doctoroimgs;
  public $doctoroimgs01;
  public $doctoroimgs02;
  public $doctoroimgsl;
  public $doctoroimgsl01;
  public $doctoroimgsl02;
  public $doctoroimgsr;
  public $doctoroimgsr01;
  public $doctoroimgsr02;

  public $status = 0;



  use ShusyTaxationSexTrait;
  use ShusyTaxationStatusTrait;

  function __construct($values = []) {
    $this->is_new_revision = TRUE;

    parent::__construct($values, 'shusy_taxation');
  }

  public function save() {

    $this->changed = REQUEST_TIME;
    if (empty($this->created)) {
      $this->created = REQUEST_TIME;
    }

    if (empty($this->uid)) {
      $this->uid = $GLOBALS['user']->uid;
    }

    return parent::save();
  }

  public function label() {
    return "{$this->store_name} ({$this->id}) [{$this->name}]";
  }

}
